<?php
/**
 * Created by PhpStorm.
 * User: Aliaksei Lazerka
 * Date: 9/28/14
 * Time: 11:28 AM
 */


use parser\XMLParser;

include_once("../NymphFramework.php");


class XMLParserImpl extends XMLParser
{

  private $tmpFiles = array('../conf/xml/test.xml');

  function init()
  {
    $this->addFilesToParse($this->tmpFiles);
  }

  /**
   * (PHP 5)<br/>
   * Trying to parse some object
   * @param string $object
   * @return array array with parsed object
   */
  function parse($object)
  {
    $xmlFile = simplexml_load_file($object);
    foreach ($xmlFile->logger as $logger) {
      echo "Logger:" . $logger['name'] . "<br>";
      echo "Type:" . $logger['type'] . "<br>";
      echo "Pattern:" . $logger->config->pattern . "<br>";
      echo "Pattern:" . $logger->config->logLevel. "<br>";
      echo "Pattern:" . $logger->config->pathToFile. "<br>";
    }
  }
}